#======文字编码=====
#======字节===bytes===bytearray===chr（）编号-字节  ord（）#字节-编号
# ord('s')
# s = 'hello 小张'
# b = s.encode() #将字符串 编码为字节串是
# print(b)
# print(f'编码前有字符串{len(s)}，编码后有{len(b)}个字节')
#
# s2 = b.decode() #将字节串 解码为字符串
#
# print('s2:', s2)
# wenajian========================================
# try:
#      file = open('hah.txt', mode='rt')
#      for s in range(3):
#           content = file.readline()# readline     readdlines    一行一行的读
#           content =content.strip()
#           anser = content.split('，')
#           print(f'{anser[0]}，今年{anser[1]}岁，成绩{anser[2]}分')
# except OSError:
#      print('打开失败')

#===============练习=================================

fw = open('mynote.txt','w')
fw.write('我来做曾是')
fw.write('哈哈哈')
fw.write('是不是')
fw.close()